home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / includ~1.z / includ~1 / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-04  |  2.1 KB  |  66 lines

  1. /* The <time.h> header is used by the procedures that deal with time.
  2.  * Handling time is surprisingly complicated, what with GMT, local time
  3.  * and other factors.  Although the Bishop of Ussher (1581-1656) once
  4.  * calculated that based on the Bible, the world began on 12 Oct. 4004 BC
  5.  * at 9 o'clock in the morning, in the UNIX world time begins at midnight, 
  6.  * 1 Jan. 1970 GMT.  Before that, all was NULL and (void).
  7.  */
  8.  
  9. #ifndef _TIME_H
  10. #define _TIME_H
  11.  
  12. #define CLOCKS_PER_SEC    60    /* MINIX always uses 60 Hz, even in Europe */
  13.  
  14. #ifdef _POSIX_SOURCE
  15. #define CLK_TCK CLOCKS_PER_SEC    /* obsolete name for CLOCKS_PER_SEC */
  16. #endif
  17.  
  18. #ifndef NULL
  19. #define NULL    ((void *) 0)
  20. #endif
  21.  
  22. #ifndef _TIME_T
  23. #define _TIME_T
  24. typedef long time_t;        /* time in sec since 1 Jan 1970 0000 GMT */
  25. #endif
  26.  
  27. #ifndef _CLOCK_T
  28. #define _CLOCK_T
  29. typedef    long clock_t;        /* time in ticks since process started */
  30. #endif
  31.  
  32. struct tm {
  33.   int tm_sec;            /* seconds after the minute [0, 59] */
  34.   int tm_min;            /* minutes after the hour [0, 59] */
  35.   int tm_hour;            /* hours since midnight [0, 28] */
  36.   int tm_mday;            /* day of the month [1, 31] */
  37.   int tm_mon;            /* months since January [0, 11] */
  38.   int tm_year;            /* years since 1900 */
  39.   int tm_wday;            /* days since Sunday [0, 6] */
  40.   int tm_yday;            /* days since January 1 [0, 365] */
  41.   int tm_isdst;            /* Daylight Saving Time flag */
  42. };
  43.  
  44. /* Function Prototypes. */
  45. #ifndef _ANSI_H
  46. #include <ansi.h>
  47. #endif
  48.  
  49. _PROTOTYPE( clock_t clock, (void)                       );
  50. _PROTOTYPE( double difftime, (time_t __time1, time_t __time0)           );
  51. _PROTOTYPE( time_t mktime, (const struct tm *__timeptr)               );
  52. _PROTOTYPE( time_t time, (time_t *__timeptr)                   );
  53. _PROTOTYPE( char *asctime, (const struct tm *__timeptr)                  );
  54. _PROTOTYPE( char *ctime, (const time_t *__timer)               );
  55. _PROTOTYPE( struct tm *gmtime, (const time_t *__timer)               );
  56. _PROTOTYPE( struct tm *localtime, (const time_t *__timer)           );
  57. _PROTOTYPE( time_t time, (time_t *__tloc)                   );
  58. _PROTOTYPE( size_t strftime, \
  59.     (char *__s, size_t __max, char *__fmt, const struct tm *__timep)   );
  60.  
  61. #ifdef _POSIX_SOURCE
  62. _PROTOTYPE( void tzset, (void)                           );
  63. #endif
  64.  
  65. #endif /* _TIME_H */
  66.